﻿using System;
using System.Collections.Generic;
using System.Text;
using Abp.Timing.Timezone;
using AbpDemo.Domain.Orders;
using AutoMapper;

namespace AbpDemo.Orders.Dto
{
    public class OrderMapProfile : Profile
    {
        public OrderMapProfile()
        {
            CreateMap<DateTime, DateTime>().ConvertUsing(x => TimezoneHelper.ConvertFromUtc(x, TimeZoneInfo.Local.Id) ?? x);
            CreateMap<DateTime?, DateTime?>().ConvertUsing(x => TimezoneHelper.ConvertFromUtc(x, TimeZoneInfo.Local.Id));

            //CreateMap<OrderItem_1, OrderItemDto>()
                //.ForMember(d=>d.GoodsDesc, opt=>opt.MapFrom(s=>s.Goods.Desc))
                //.ReverseMap()
                //                ;
        }
    }
}
